Optimal. Leaf size=136 \[ \frac {(a+b x) \tanh ^{-1}(a+b x)}{b^2}-\frac {a \tanh ^{-1}(a+b x)^2}{b^2}-\frac {\left (1+a^2\right ) \tanh ^{-1}(a+b x)^2}{2 b^2}+\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2+\frac {2 a \tanh ^{-1}(a+b x) \log \left (\frac {2}{1-a-b x}\right )}{b^2}+\frac {\log \left (1-(a+b x)^2\right )}{2 b^2}+\frac {a \text {PolyLog}\left (2,-\frac {1+a+b x}{1-a-b x}\right )}{b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 10, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {6246, 6065,
6021, 266, 6195, 6095, 6131, 6055, 2449, 2352} \begin {gather*} -\frac {\left (a^2+1\right ) \tanh ^{-1}(a+b x)^2}{2 b^2}+\frac {a \text {Li}_2\left (-\frac {a+b x+1}{-a-b x+1}\right )}{b^2}+\frac {\log \left (1-(a+b x)^2\right )}{2 b^2}-\frac {a \tanh ^{-1}(a+b x)^2}{b^2}+\frac {(a+b x) \tanh ^{-1}(a+b x)}{b^2}+\frac {2 a \log \left (\frac {2}{-a-b x+1}\right ) \tanh ^{-1}(a+b x)}{b^2}+\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 266
Rule 2352
Rule 2449
Rule 6021
Rule 6055
Rule 6065
Rule 6095
Rule 6131
Rule 6195
Rule 6246
Rubi steps
\begin {align*} \int x \tanh ^{-1}(a+b x)^2 \, dx &=\frac {\text {Subst}\left (\int \left (-\frac {a}{b}+\frac {x}{b}\right ) \tanh ^{-1}(x)^2 \, dx,x,a+b x\right )}{b}\\ &=\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2-\text {Subst}\left (\int \left (-\frac {\tanh ^{-1}(x)}{b^2}+\frac {\left (1+a^2-2 a x\right ) \tanh ^{-1}(x)}{b^2 \left (1-x^2\right )}\right ) \, dx,x,a+b x\right )\\ &=\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2+\frac {\text {Subst}\left (\int \tanh ^{-1}(x) \, dx,x,a+b x\right )}{b^2}-\frac {\text {Subst}\left (\int \frac {\left (1+a^2-2 a x\right ) \tanh ^{-1}(x)}{1-x^2} \, dx,x,a+b x\right )}{b^2}\\ &=\frac {(a+b x) \tanh ^{-1}(a+b x)}{b^2}+\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2-\frac {\text {Subst}\left (\int \frac {x}{1-x^2} \, dx,x,a+b x\right )}{b^2}-\frac {\text {Subst}\left (\int \left (\frac {\left (1+a^2\right ) \tanh ^{-1}(x)}{1-x^2}-\frac {2 a x \tanh ^{-1}(x)}{1-x^2}\right ) \, dx,x,a+b x\right )}{b^2}\\ &=\frac {(a+b x) \tanh ^{-1}(a+b x)}{b^2}+\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2+\frac {\log \left (1-(a+b x)^2\right )}{2 b^2}+\frac {(2 a) \text {Subst}\left (\int \frac {x \tanh ^{-1}(x)}{1-x^2} \, dx,x,a+b x\right )}{b^2}-\frac {\left (1+a^2\right ) \text {Subst}\left (\int \frac {\tanh ^{-1}(x)}{1-x^2} \, dx,x,a+b x\right )}{b^2}\\ &=\frac {(a+b x) \tanh ^{-1}(a+b x)}{b^2}-\frac {a \tanh ^{-1}(a+b x)^2}{b^2}-\frac {\left (1+a^2\right ) \tanh ^{-1}(a+b x)^2}{2 b^2}+\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2+\frac {\log \left (1-(a+b x)^2\right )}{2 b^2}+\frac {(2 a) \text {Subst}\left (\int \frac {\tanh ^{-1}(x)}{1-x} \, dx,x,a+b x\right )}{b^2}\\ &=\frac {(a+b x) \tanh ^{-1}(a+b x)}{b^2}-\frac {a \tanh ^{-1}(a+b x)^2}{b^2}-\frac {\left (1+a^2\right ) \tanh ^{-1}(a+b x)^2}{2 b^2}+\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2+\frac {2 a \tanh ^{-1}(a+b x) \log \left (\frac {2}{1-a-b x}\right )}{b^2}+\frac {\log \left (1-(a+b x)^2\right )}{2 b^2}-\frac {(2 a) \text {Subst}\left (\int \frac {\log \left (\frac {2}{1-x}\right )}{1-x^2} \, dx,x,a+b x\right )}{b^2}\\ &=\frac {(a+b x) \tanh ^{-1}(a+b x)}{b^2}-\frac {a \tanh ^{-1}(a+b x)^2}{b^2}-\frac {\left (1+a^2\right ) \tanh ^{-1}(a+b x)^2}{2 b^2}+\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2+\frac {2 a \tanh ^{-1}(a+b x) \log \left (\frac {2}{1-a-b x}\right )}{b^2}+\frac {\log \left (1-(a+b x)^2\right )}{2 b^2}+\frac {(2 a) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1-a-b x}\right )}{b^2}\\ &=\frac {(a+b x) \tanh ^{-1}(a+b x)}{b^2}-\frac {a \tanh ^{-1}(a+b x)^2}{b^2}-\frac {\left (1+a^2\right ) \tanh ^{-1}(a+b x)^2}{2 b^2}+\frac {1}{2} x^2 \tanh ^{-1}(a+b x)^2+\frac {2 a \tanh ^{-1}(a+b x) \log \left (\frac {2}{1-a-b x}\right )}{b^2}+\frac {\log \left (1-(a+b x)^2\right )}{2 b^2}+\frac {a \text {Li}_2\left (1-\frac {2}{1-a-b x}\right )}{b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.20, size = 98, normalized size = 0.72 \begin {gather*} \frac {\left (-1+2 a-a^2+b^2 x^2\right ) \tanh ^{-1}(a+b x)^2+2 \tanh ^{-1}(a+b x) \left (a+b x+2 a \log \left (1+e^{-2 \tanh ^{-1}(a+b x)}\right )\right )-2 \log \left (\frac {1}{\sqrt {1-(a+b x)^2}}\right )-2 a \text {PolyLog}\left (2,-e^{-2 \tanh ^{-1}(a+b x)}\right )}{2 b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(311\) vs.
\(2(132)=264\).
time = 0.07, size = 312, normalized size = 2.29
method | result | size |
derivativedivides | \(\frac {\frac {\arctanh \left (b x +a \right )^{2} \left (b x +a \right )^{2}}{2}-\arctanh \left (b x +a \right )^{2} \left (b x +a \right ) a +\arctanh \left (b x +a \right ) \left (b x +a \right )-\arctanh \left (b x +a \right ) \ln \left (b x +a -1\right ) a +\frac {\arctanh \left (b x +a \right ) \ln \left (b x +a -1\right )}{2}-\arctanh \left (b x +a \right ) \ln \left (b x +a +1\right ) a -\frac {\arctanh \left (b x +a \right ) \ln \left (b x +a +1\right )}{2}+\frac {\ln \left (b x +a -1\right )}{2}+\frac {\ln \left (b x +a +1\right )}{2}-\frac {\ln \left (b x +a -1\right )^{2} a}{4}+\dilog \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right ) a +\frac {\ln \left (b x +a -1\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right ) a}{2}+\frac {\ln \left (b x +a -1\right )^{2}}{8}-\frac {\ln \left (b x +a -1\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{4}-\frac {\ln \left (b x +a +1\right ) \ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) a}{2}+\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right ) a}{2}+\frac {\ln \left (b x +a +1\right )^{2} a}{4}-\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (b x +a +1\right )}{4}+\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{4}+\frac {\ln \left (b x +a +1\right )^{2}}{8}}{b^{2}}\) | \(312\) |
default | \(\frac {\frac {\arctanh \left (b x +a \right )^{2} \left (b x +a \right )^{2}}{2}-\arctanh \left (b x +a \right )^{2} \left (b x +a \right ) a +\arctanh \left (b x +a \right ) \left (b x +a \right )-\arctanh \left (b x +a \right ) \ln \left (b x +a -1\right ) a +\frac {\arctanh \left (b x +a \right ) \ln \left (b x +a -1\right )}{2}-\arctanh \left (b x +a \right ) \ln \left (b x +a +1\right ) a -\frac {\arctanh \left (b x +a \right ) \ln \left (b x +a +1\right )}{2}+\frac {\ln \left (b x +a -1\right )}{2}+\frac {\ln \left (b x +a +1\right )}{2}-\frac {\ln \left (b x +a -1\right )^{2} a}{4}+\dilog \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right ) a +\frac {\ln \left (b x +a -1\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right ) a}{2}+\frac {\ln \left (b x +a -1\right )^{2}}{8}-\frac {\ln \left (b x +a -1\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{4}-\frac {\ln \left (b x +a +1\right ) \ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) a}{2}+\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right ) a}{2}+\frac {\ln \left (b x +a +1\right )^{2} a}{4}-\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (b x +a +1\right )}{4}+\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{4}+\frac {\ln \left (b x +a +1\right )^{2}}{8}}{b^{2}}\) | \(312\) |
risch | \(-\frac {\left (-x^{2} b^{2}+a^{2}+2 a +1\right ) \ln \left (b x +a +1\right )^{2}}{8 b^{2}}+\left (-\frac {\ln \left (-b x -a +1\right ) x^{2}}{4}-\frac {-\ln \left (-b x -a +1\right ) a^{2}+2 \ln \left (-b x -a +1\right ) a -2 b x -\ln \left (-b x -a +1\right )}{4 b^{2}}\right ) \ln \left (b x +a +1\right )-\frac {\ln \left (-b x -a +1\right ) x^{2}}{8}+\frac {x^{2} \ln \left (-b x -a +1\right )^{2}}{8}+\frac {\ln \left (-b x -a +1\right ) \left (-b x -a +1\right ) a}{2 b^{2}}+\frac {\ln \left (-b x -a +1\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right ) a}{b^{2}}-\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right ) a}{b^{2}}+\frac {\ln \left (-b x -a -1\right )}{2 b^{2}}+\frac {3 \ln \left (-b x -a +1\right )}{8 b^{2}}-\frac {\ln \left (-b x -a +1\right )^{2}}{8 b^{2}}+\frac {\ln \left (-b x -a +1\right ) \left (-b x -a +1\right )^{2}}{8 b^{2}}-\frac {\dilog \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) a}{b^{2}}-\frac {\ln \left (-b x -a +1\right )^{2} a^{2}}{8 b^{2}}+\frac {\ln \left (-b x -a +1\right )^{2} a}{4 b^{2}}+\frac {3 \ln \left (-b x -a +1\right ) a^{2}}{8 b^{2}}-\frac {3 \ln \left (-b x -a +1\right ) a}{4 b^{2}}-\frac {\ln \left (-b x -a +1\right ) x}{4 b}+\frac {a \ln \left (-b x -a -1\right )}{2 b^{2}}+\frac {\ln \left (-b x -a +1\right ) x a}{4 b}\) | \(424\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 202, normalized size = 1.49 \begin {gather*} \frac {1}{2} \, x^{2} \operatorname {artanh}\left (b x + a\right )^{2} + \frac {1}{8} \, b^{2} {\left (\frac {8 \, {\left (\log \left (b x + a - 1\right ) \log \left (\frac {1}{2} \, b x + \frac {1}{2} \, a + \frac {1}{2}\right ) + {\rm Li}_2\left (-\frac {1}{2} \, b x - \frac {1}{2} \, a + \frac {1}{2}\right )\right )} a}{b^{4}} + \frac {4 \, {\left (a + 1\right )} \log \left (b x + a + 1\right )}{b^{4}} + \frac {{\left (a^{2} + 2 \, a + 1\right )} \log \left (b x + a + 1\right )^{2} - 2 \, {\left (a^{2} + 2 \, a + 1\right )} \log \left (b x + a + 1\right ) \log \left (b x + a - 1\right ) + {\left (a^{2} - 2 \, a + 1\right )} \log \left (b x + a - 1\right )^{2} - 4 \, {\left (a - 1\right )} \log \left (b x + a - 1\right )}{b^{4}}\right )} + \frac {1}{2} \, b {\left (\frac {2 \, x}{b^{2}} - \frac {{\left (a^{2} + 2 \, a + 1\right )} \log \left (b x + a + 1\right )}{b^{3}} + \frac {{\left (a^{2} - 2 \, a + 1\right )} \log \left (b x + a - 1\right )}{b^{3}}\right )} \operatorname {artanh}\left (b x + a\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x \operatorname {atanh}^{2}{\left (a + b x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x\,{\mathrm {atanh}\left (a+b\,x\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________